Skip to content

[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty. #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2019

Conversation

drodriguez
Copy link
Contributor

In platforms like Windows, there's no prefix for static libraries.
Interpolating it in the regex will end up with a regex "^", which seems
not to be valid. Since the regex was removing the prefix, we can simply
skip the operation and the result will be the same.

Also do the same for CMAKE_STATIC_LIBRARY_SUFFIX, even if in that case,
Windows will have a value (but if it is empty, it will fail trying to
create the regex).

In platforms like Windows, there's no prefix for static libraries.
Interpolating it in the regex will end up with a regex "^", which seems
not to be valid. Since the regex was removing the prefix, we can simply
skip the operation and the result will be the same.

Also do the same for CMAKE_STATIC_LIBRARY_SUFFIX, even if in that case,
Windows will have a value (but if it is empty, it will fail trying to
create the regex).
@drodriguez
Copy link
Contributor Author

Same fix in foundation: swiftlang/swift-corelibs-foundation#1971
Same fix in xctest: swiftlang/swift-corelibs-xctest#257

@ktopley-apple
Copy link
Contributor

@swift-ci please test

@ktopley-apple ktopley-apple self-requested a review March 21, 2019 17:45
@ktopley-apple
Copy link
Contributor

@swift-ci please test

@ktopley-apple ktopley-apple merged commit 319bd33 into swiftlang:master Mar 22, 2019
@drodriguez drodriguez deleted the fix-regex-windows branch April 8, 2019 20:30
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty.

Signed-off-by: Kim Topley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants